Skip to content

fix: index name quotation#81

Merged
tianzhou merged 1 commit intomainfrom
index_quote
Oct 14, 2025
Merged

fix: index name quotation#81
tianzhou merged 1 commit intomainfrom
index_quote

Conversation

@tianzhou
Copy link
Contributor

Fix #80

Copilot AI review requested due to automatic review settings October 14, 2025 16:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes index name quotation issues (GitHub issue #80) by ensuring that index names requiring quotation are properly quoted when generating SQL statements. The fix addresses cases where index names contain spaces, special characters, mixed case, or reserved keywords.

  • Updates SQL generation code to properly quote index names using ir.QuoteIdentifier()
  • Adds comprehensive test coverage with various index naming scenarios
  • Ensures compatibility between pgschema output and PostgreSQL's quoting requirements

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testdata/dump/issue_80_index_name_quote/raw.sql Test data with various index naming scenarios requiring quotation
testdata/dump/issue_80_index_name_quote/pgschema.sql Expected pgschema output with properly quoted index names
testdata/dump/issue_80_index_name_quote/pgdump.sql Reference pg_dump output for comparison
testdata/dump/issue_80_index_name_quote/manifest.json Test case metadata and description
internal/plan/rewrite.go Fixed index name quoting in DROP and ALTER INDEX statements
internal/diff/index.go Fixed index name quoting in CREATE INDEX statements
cmd/dump/dump_integration_test.go Added integration test for the index name quotation fix

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tianzhou tianzhou merged commit 13efbcc into main Oct 14, 2025
2 checks passed
@tianzhou tianzhou deleted the index_quote branch October 23, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Identifiers for index objects are not quoted where appropriate

2 participants